//#define __DEBUG__
// by Xeno
#define THIS_FILE "fn_huddispmsg.sqf"
#include "x_setup.sqf"

private ["_msg", "_hud", "_control", "_cpos", "_control2", "_cpos2", "_endtime"];
PARAMS_1(_msg);
if (GVAR(msg_hud_shown)) exitWith {};
GVAR(msg_hud_shown) = true;
disableSerialization;
89643 cutRsc [QGVAR(message_hud),"PLAIN"];
_hud = __uiGetVar(DMESSAGE_HUD);
_control = _hud displayCtrl 1000;
_cpos = ctrlPosition _control;
_control ctrlSetPosition [_cpos select 0, SafeZoneY + SafeZoneH - 0.07, _cpos select 2, _cpos select 3];
_control2 = _hud displayCtrl 1001;
_control2 ctrlSetText _msg;
_cpos2 = ctrlPosition _control2;
_control2 ctrlSetPosition [_cpos2 select 0, SafeZoneY + SafeZoneH - 0.068, _cpos2 select 2, _cpos2 select 3];
_control ctrlCommit 0.5;
_control2 ctrlCommit 0.5;
_endtime = time + 19;
waitUntil {time > _endtime || {!alive player} || {__pGetVar(xr_pluncon)}};
_control ctrlSetPosition _cpos;
_control2 ctrlSetPosition _cpos2;
_control ctrlCommit 0.5;
_control2 ctrlCommit 0.5;
GVAR(msg_hud_shown) = false;